// 规格选择
import React, { useState, useEffect } from 'react'
import { SpecData } from '../../components/GetServerData'
import OptionsBtn from '../../components/OptionsBtn'
export default function Spec() {
  const [conf, setConf] = useState([])
  const [cupType, setCupType] = useState([])
  const getList = async () => {
    const list = await SpecData().then(res => {
      return res.data
    })
    setConf(list.conf)
    setCupType(list.cupType)
  }
  useEffect(() => {
    getList()

  }, [])
  return (

    <div className='Spec'>
      <div className='beizi'>
        <h3>杯型</h3>
        <OptionsBtn data={cupType} />
      </div>
      <div className='lengre'>
        <h3>温度</h3>
        <OptionsBtn data={conf} />
      </div>
    </div>
  )
}
